<template>
   <div class="box">
    <div class="header">
      <div class="top">
        <ul class="onShow">
          <li @click="show1"  :class="flag ? 'active':''">正在热映</li>
          <li @click="show2" :class="flag ? '':'active'">即将热映</li>
        </ul>
      </div>
        <MoveListHome v-if="flag" :prolist="prolist"></MoveListHome>
        <MoveList v-else></MoveList>
    </div>
   </div>
</template>

<script>
import MoveList from '@/components/moveList'
import MoveListHome from '@/components/moveListHome'
import { getprolist } from '@/api'
export default {
  data () {
    return {
      prolist: [],
      loading: false,
      finished: false,
      isLoading: false,
      flag: true,
      style: ''
    }
  },
  components: {
    MoveList,
    MoveListHome
  },
  mounted () {
    getprolist().then(res => {
      console.log(res.data.data)
      this.prolist = res.data.data
    })
  },
  methods: {
    show1 () {
      this.flag = true
    },
    show2 () {
      this.flag = false
    }
  }
}
</script>

<style lang="scss">
.onShow{
  width:250px;
  height: 100%;
  font-size: 20px;
  float: right;
  display: flex;
  li{
    width: 100%;
    height: 100%;
    line-height: 50px;
    text-align: center;
    // border-bottom: 3px solid red;
    flex: 1;
  }
}
.active{
  border-bottom: 3px solid red;
  color: red;
}
.active2{
    border-bottom: 3px solid blue;
    color: red;
}
</style>
